package com.chushouya.controller.order.clerk;

import com.chushouya.common.annotations.AuthValidate;
import com.chushouya.common.constant.ServiceType;
import com.general.framework.core.schema.Response;
import com.chushouya.order.dto.api.quality.QualityItemApiDTO;
import com.chushouya.order.service.api.ClerkOrderQualityApiService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@Api(tags = ServiceType.CLERK + "业务员质检接口")
@RestController
@RequestMapping(ServiceType.CLERK + "/quality")
public class ClerkQualityApiController {

    @Resource
    private ClerkOrderQualityApiService clerkOrderQualityApiService;

    @GetMapping("/qualityItem")
    @ApiOperation("获取质检项列表")
    @AuthValidate
    public Response<List<QualityItemApiDTO>> qualityItem(Long orderId) {
        return Response.success(clerkOrderQualityApiService.orderQualityItem(orderId));
    }
}
